/*
stm32f4xx  176pin chip version V3
��ӦӲ���汾  V0.40A



 


*/
 

#ifndef _STM32F4xxI176_IO_V3_H
#define _STM32F4xxI176_IO_V3_H 

 /*********************************P12V1  PB4*/ 
/*端口定义*/
#define P12V1_PORT		GPIOB
#define P12V1_PIN		GPIO_PIN_4
#define P12V1_RCC_ENABLE()	__HAL_RCC_GPIOB_CLK_ENABLE() 
/*位带操作*/
#define	P12V1_BitNum	4 
#define	P12V1_ADDR		GPIOB_ODR_Addr 

/*********************************板载wakeup按钮 PA0*/ 
/*端口定义*/
#define WKUP_PORT		GPIOA
#define WKUP_PIN		GPIO_PIN_0
#define WKUP_RCC_ENABLE()	__HAL_RCC_GPIOA_CLK_ENABLE() 
/*位带操作*/
#define	WKUP_BitNum	0 
#define	WKUP_ADDR	GPIOA_ODR_Addr 

 /********************************* LED1   PB1*/ 
/*端口定义*/
#define LED1_PORT		GPIOB
#define LED1_PIN		GPIO_PIN_1
#define LED1_RCC_ENABLE()	__HAL_RCC_GPIOB_CLK_ENABLE() 
/*位带操作*/
#define	LED1_BitNum	1 
#define	LED1_ADDR	GPIOB_ODR_Addr 

 /*********************************BUZZER PC13*/ 
/*端口定义*/
#define BUZZER_PORT		GPIOC 
#define BUZZER_PIN		GPIO_PIN_13 
#define BUZZER_RCC_ENABLE()	__HAL_RCC_GPIOC_CLK_ENABLE()   
/*位带操作*/
#define	BUZZER_BitNum		13
#define	BUZZER_ADDR		GPIOC_ODR_Addr 
 /*********************************POINT  PB11*/ 
/*端口定义*/
#define POINT_PORT			GPIOB 
#define POINT_PIN			GPIO_PIN_11 
#define POINT_RCC_ENABLE()	__HAL_RCC_GPIOB_CLK_ENABLE()   
/*位带操作*/
#define	POINT_BitNum		11 
#define	POINT_ADDR		GPIOB_ODR_Addr 
 /*********************************QEN  PD7*/ 
/*端口定义*/
#define QEN_PORT		GPIOD
#define QEN_PIN			GPIO_PIN_7
#define QEN_RCC_ENABLE()	__HAL_RCC_GPIOD_CLK_ENABLE()   
/*位带操作*/
#define	QEN_BitNum		7 
#define	QEN_ADDR		GPIOD_ODR_Addr  
 
 /*********************************DOUT_EN  PB0*/ 
/*端口定义*/
#define DOUT_EN_PORT		GPIOB
#define DOUT_EN_PIN			GPIO_PIN_0 
#define DOUT_EN_RCC_ENABLE()	__HAL_RCC_GPIOB_CLK_ENABLE()   
/*位带操作*/
#define	DOUT_EN_BitNum		0 
#define	DOUT_EN_ADDR		GPIOB_ODR_Addr  
 /*********************************DOUT_LATCH PB2*/ 
/*端口定义*/
#define DOUT_LATCH_PORT			GPIOB
#define DOUT_LATCH_PIN			GPIO_PIN_2 
#define DOUT_LATCH_RCC_ENABLE()	__HAL_RCC_GPIOB_CLK_ENABLE()   
/*位带操作*/
#define	DOUT_LATCH_BitNum		2 
#define	DOUT_LATCH_ADDR			GPIOB_ODR_Addr  
 /*********************************DIN_BUS_EN  PD3*/ 
/*端口定义*/
#define DIN_BUS_EN_PORT			GPIOD
#define DIN_BUS_EN_PIN			GPIO_PIN_3 
#define DIN_BUS_EN_RCC_ENABLE()	__HAL_RCC_GPIOD_CLK_ENABLE()   
/*位带操作*/
#define	DIN_BUS_EN_BitNum		3 
#define	DIN_BUS_EN_ADDR			GPIOD_ODR_Addr 
 /******************************** */ 
/*
M1_STUTAS_EN		PB14
M1_DATA_EN			PB13
M1_CONTROL_EN0 		PI0
M1_CONTROL_EN1 		PI1 

*/
/*端口定义*/
#define M1_STUTAS_EN_PORT		GPIOB 
#define M1_STUTAS_EN_PIN		GPIO_PIN_14   
#define M1_STUTAS_EN_RCC_ENABLE()	__HAL_RCC_GPIOB_CLK_ENABLE() 
/*位带操作*/
#define	M1_STUTAS_EN_BitNum		14   
#define	M1_STUTAS_EN_ADDR		GPIOB_ODR_Addr 
/*端口定义*/
#define M1_CONTROL_EN0_PORT		GPIOI 
#define M1_CONTROL_EN1_PORT		GPIOI 
#define M1_CONTROL_EN0_PIN			GPIO_PIN_0 
#define M1_CONTROL_EN1_PIN			GPIO_PIN_1 
#define M1_CONTROL_EN0_RCC_ENABLE()	__HAL_RCC_GPIOI_CLK_ENABLE()  
#define M1_CONTROL_EN1_RCC_ENABLE()	__HAL_RCC_GPIOI_CLK_ENABLE()  
/*位带操作*/
#define	M1_CONTROL_EN0_BitNum		0 
#define	M1_CONTROL_EN1_BitNum		1 
#define	M1_CONTROL_EN0_ADDR		GPIOI_ODR_Addr  
#define	M1_CONTROL_EN1_ADDR		GPIOI_ODR_Addr 
/*端口定义*/
#define M1_DATA_EN_PORT		GPIOB 
#define M1_DATA_EN_PIN		GPIO_PIN_13 
#define M1_DATA_EN_RCC_ENABLE()	__HAL_RCC_GPIOB_CLK_ENABLE()    
/*位带操作*/
#define	M1_DATA_EN_BitNum		13 
#define	M1_DATA_EN_ADDR		GPIOB_ODR_Addr   
 /********************************RS485��ض���*/ 
/*端口定义*/
/*
RS485_CON	PB10 
RS485_RXD	PA3
RS485_TXD	PA2  
*/
#define RS485_CON_PORT		GPIOB
#define RS485_RXD_PORT		GPIOA
#define RS485_TXD_PORT		GPIOA
#define RS485_CON_PIN			GPIO_PIN_10 
#define RS485_RXD_PIN			GPIO_PIN_3 
#define RS485_TXD_PIN			GPIO_PIN_2  
#define RS485_CON_RCC_ENABLE()	__HAL_RCC_GPIOB_CLK_ENABLE()   
#define RS485_RXD_RCC_ENABLE()	__HAL_RCC_GPIOA_CLK_ENABLE()  
#define RS485_TXD_RCC_ENABLE()	__HAL_RCC_GPIOA_CLK_ENABLE()  
/*位带操作*/
#define	RS485_CON_BitNum		10 
#define	RS485_RXD_BitNum		3 
#define	RS485_TXD_BitNum		2  
#define	RS485_CON_ADDR		GPIOB_ODR_Addr 
#define	RS485_RXD_ADDR		GPIOA_ODR_Addr 
#define	RS485_TXD_ADDR		GPIOA_ODR_Addr 


/*端口定义*/
/*
	Mcu_Data0	PG6
	Mcu_Data1	PC6
	Mcu_Data2	PC7
	Mcu_Data3	PC8
	Mcu_Data4	PC9
	Mcu_Data5	PA8
	Mcu_Data6	PD12
	Mcu_Data7	PD5
	Mcu_Data8	PD11
	Mcu_Data9	PH12
	Mcu_Data10	PG12
	Mcu_Data11	PD4
	Mcu_Data12	PD6
	Mcu_Data13	PH15
	Mcu_Data14	PH14
	Mcu_Data15	PH13  
*/  
#define Mcu_Data0_PORT		GPIOG
#define Mcu_Data1_PORT		GPIOC
#define Mcu_Data2_PORT		GPIOC
#define Mcu_Data3_PORT		GPIOC
#define Mcu_Data4_PORT		GPIOC
#define Mcu_Data5_PORT		GPIOA
#define Mcu_Data6_PORT		GPIOD
#define Mcu_Data7_PORT		GPIOD
#define Mcu_Data8_PORT		GPIOD
#define Mcu_Data9_PORT		GPIOH
#define Mcu_Data10_PORT		GPIOG
#define Mcu_Data11_PORT		GPIOD
#define Mcu_Data12_PORT		GPIOD
#define Mcu_Data13_PORT		GPIOH
#define Mcu_Data14_PORT		GPIOH
#define Mcu_Data15_PORT		GPIOH 
#define Mcu_Data0_PIN		GPIO_PIN_6
#define Mcu_Data1_PIN		GPIO_PIN_6
#define Mcu_Data2_PIN		GPIO_PIN_7
#define Mcu_Data3_PIN		GPIO_PIN_8
#define Mcu_Data4_PIN		GPIO_PIN_9
#define Mcu_Data5_PIN		GPIO_PIN_8
#define Mcu_Data6_PIN		GPIO_PIN_12
#define Mcu_Data7_PIN		GPIO_PIN_5
#define Mcu_Data8_PIN		GPIO_PIN_11
#define Mcu_Data9_PIN		GPIO_PIN_12
#define Mcu_Data10_PIN		GPIO_PIN_12
#define Mcu_Data11_PIN		GPIO_PIN_4
#define Mcu_Data12_PIN		GPIO_PIN_6
#define Mcu_Data13_PIN		GPIO_PIN_15
#define Mcu_Data14_PIN		GPIO_PIN_14
#define Mcu_Data15_PIN		GPIO_PIN_13   
#define Mcu_Data0_RCC_ENABLE()	__HAL_RCC_GPIOG_CLK_ENABLE()  
#define Mcu_Data1_RCC_ENABLE()	__HAL_RCC_GPIOC_CLK_ENABLE() 
#define Mcu_Data2_RCC_ENABLE()	__HAL_RCC_GPIOC_CLK_ENABLE() 
#define Mcu_Data3_RCC_ENABLE()	__HAL_RCC_GPIOC_CLK_ENABLE() 
#define Mcu_Data4_RCC_ENABLE()	__HAL_RCC_GPIOC_CLK_ENABLE()  
#define Mcu_Data5_RCC_ENABLE()	__HAL_RCC_GPIOA_CLK_ENABLE() 
#define Mcu_Data6_RCC_ENABLE()	__HAL_RCC_GPIOD_CLK_ENABLE() 
#define Mcu_Data7_RCC_ENABLE()	__HAL_RCC_GPIOD_CLK_ENABLE() 
#define Mcu_Data8_RCC_ENABLE()	__HAL_RCC_GPIOD_CLK_ENABLE()  
#define Mcu_Data9_RCC_ENABLE()	__HAL_RCC_GPIOH_CLK_ENABLE() 
#define Mcu_Data10_RCC_ENABLE()	__HAL_RCC_GPIOG_CLK_ENABLE() 
#define Mcu_Data11_RCC_ENABLE()	__HAL_RCC_GPIOD_CLK_ENABLE() 
#define Mcu_Data12_RCC_ENABLE()	__HAL_RCC_GPIOD_CLK_ENABLE()  
#define Mcu_Data13_RCC_ENABLE()	__HAL_RCC_GPIOH_CLK_ENABLE() 
#define Mcu_Data14_RCC_ENABLE()	__HAL_RCC_GPIOH_CLK_ENABLE() 
#define Mcu_Data15_RCC_ENABLE()	__HAL_RCC_GPIOH_CLK_ENABLE()  
/*位带操作*/
#define	Mcu_Data0_BitNum			6
#define	Mcu_Data1_BitNum			6
#define	Mcu_Data2_BitNum			7
#define	Mcu_Data3_BitNum			8
#define	Mcu_Data4_BitNum			9
#define	Mcu_Data5_BitNum			8
#define	Mcu_Data6_BitNum			12
#define	Mcu_Data7_BitNum			5
#define	Mcu_Data8_BitNum			11
#define	Mcu_Data9_BitNum			12
#define	Mcu_Data10_BitNum			12
#define	Mcu_Data11_BitNum			4
#define	Mcu_Data12_BitNum			6
#define	Mcu_Data13_BitNum			15
#define	Mcu_Data14_BitNum			14
#define	Mcu_Data15_BitNum			13
#define	Mcu_Data0_ADDR		GPIOG_IDR_Addr
#define	Mcu_Data1_ADDR		GPIOC_IDR_Addr
#define	Mcu_Data2_ADDR		GPIOC_IDR_Addr
#define	Mcu_Data3_ADDR		GPIOC_IDR_Addr
#define	Mcu_Data4_ADDR		GPIOC_IDR_Addr
#define	Mcu_Data5_ADDR		GPIOA_IDR_Addr
#define	Mcu_Data6_ADDR		GPIOD_IDR_Addr
#define	Mcu_Data7_ADDR		GPIOD_IDR_Addr
#define	Mcu_Data8_ADDR		GPIOD_IDR_Addr
#define	Mcu_Data9_ADDR		GPIOH_IDR_Addr
#define	Mcu_Data10_ADDR		GPIOG_IDR_Addr
#define	Mcu_Data11_ADDR		GPIOD_IDR_Addr
#define	Mcu_Data12_ADDR		GPIOD_IDR_Addr
#define	Mcu_Data13_ADDR		GPIOH_IDR_Addr
#define	Mcu_Data14_ADDR		GPIOH_IDR_Addr
#define	Mcu_Data15_ADDR		GPIOH_IDR_Addr  
/*端口定义*/
/*
	Mcu_Control0	PB15
	Mcu_Control1	PH6
	Mcu_Control2	PH7
	Mcu_Control3	PH9
	Mcu_Control4	PH10
	Mcu_Control5	PH11
	Mcu_Control6	PG3
	Mcu_Control7	PD13
	Mcu_Control8	PA0
	Mcu_Control9	PI3
	Mcu_Control10	PI8
	Mcu_Control11	PI7
	Mcu_Control12	PI6
	Mcu_Control13	PI5
	Mcu_Control14	PI4
	Mcu_Control15	PG11  
*/  
#define Mcu_Control0_PORT		GPIOB
#define Mcu_Control1_PORT		GPIOH
#define Mcu_Control2_PORT		GPIOH
#define Mcu_Control3_PORT		GPIOH
#define Mcu_Control4_PORT		GPIOH
#define Mcu_Control5_PORT		GPIOH
#define Mcu_Control6_PORT		GPIOG
#define Mcu_Control7_PORT		GPIOD
#define Mcu_Control8_PORT		GPIOA
#define Mcu_Control9_PORT		GPIOI
#define Mcu_Control10_PORT		GPIOI
#define Mcu_Control11_PORT		GPIOI
#define Mcu_Control12_PORT		GPIOI
#define Mcu_Control13_PORT		GPIOI
#define Mcu_Control14_PORT		GPIOI
#define Mcu_Control15_PORT		GPIOG
#define Mcu_Control0_PIN		GPIO_PIN_15
#define Mcu_Control1_PIN		GPIO_PIN_6
#define Mcu_Control2_PIN		GPIO_PIN_7
#define Mcu_Control3_PIN		GPIO_PIN_9
#define Mcu_Control4_PIN		GPIO_PIN_10
#define Mcu_Control5_PIN		GPIO_PIN_11
#define Mcu_Control6_PIN		GPIO_PIN_3
#define Mcu_Control7_PIN		GPIO_PIN_13
#define Mcu_Control8_PIN		GPIO_PIN_0
#define Mcu_Control9_PIN		GPIO_PIN_3
#define Mcu_Control10_PIN		GPIO_PIN_8
#define Mcu_Control11_PIN		GPIO_PIN_7
#define Mcu_Control12_PIN		GPIO_PIN_6
#define Mcu_Control13_PIN		GPIO_PIN_5
#define Mcu_Control14_PIN		GPIO_PIN_4
#define Mcu_Control15_PIN		GPIO_PIN_11 
#define Mcu_Control0_RCC_ENABLE()	__HAL_RCC_GPIOB_CLK_ENABLE() 
#define Mcu_Control1_RCC_ENABLE()	__HAL_RCC_GPIOH_CLK_ENABLE() 
#define Mcu_Control2_RCC_ENABLE()	__HAL_RCC_GPIOH_CLK_ENABLE() 
#define Mcu_Control3_RCC_ENABLE()	__HAL_RCC_GPIOH_CLK_ENABLE() 
#define Mcu_Control4_RCC_ENABLE()	__HAL_RCC_GPIOH_CLK_ENABLE() 
#define Mcu_Control5_RCC_ENABLE()	__HAL_RCC_GPIOH_CLK_ENABLE() 
#define Mcu_Control6_RCC_ENABLE()	__HAL_RCC_GPIOG_CLK_ENABLE() 
#define Mcu_Control7_RCC_ENABLE()	__HAL_RCC_GPIOD_CLK_ENABLE() 
#define Mcu_Control8_RCC_ENABLE()	__HAL_RCC_GPIOA_CLK_ENABLE() 
#define Mcu_Control9_RCC_ENABLE()	__HAL_RCC_GPIOI_CLK_ENABLE() 
#define Mcu_Control10_RCC_ENABLE()	__HAL_RCC_GPIOI_CLK_ENABLE() 
#define Mcu_Control11_RCC_ENABLE()	__HAL_RCC_GPIOI_CLK_ENABLE() 
#define Mcu_Control12_RCC_ENABLE()	__HAL_RCC_GPIOI_CLK_ENABLE() 
#define Mcu_Control13_RCC_ENABLE()	__HAL_RCC_GPIOI_CLK_ENABLE() 
#define Mcu_Control14_RCC_ENABLE()	__HAL_RCC_GPIOI_CLK_ENABLE() 
#define Mcu_Control15_RCC_ENABLE()	__HAL_RCC_GPIOG_CLK_ENABLE() 
/*位带操作*/
#define	Mcu_Control0_BitNum			15
#define	Mcu_Control1_BitNum			6
#define	Mcu_Control2_BitNum			7
#define	Mcu_Control3_BitNum			9
#define	Mcu_Control4_BitNum			10
#define	Mcu_Control5_BitNum			11
#define	Mcu_Control6_BitNum			3
#define	Mcu_Control7_BitNum			13	
#define	Mcu_Control8_BitNum			0
#define	Mcu_Control9_BitNum			3
#define	Mcu_Control10_BitNum		8
#define	Mcu_Control11_BitNum		7
#define	Mcu_Control12_BitNum		6
#define	Mcu_Control13_BitNum		5
#define	Mcu_Control14_BitNum		4
#define	Mcu_Control15_BitNum		11  
#define	Mcu_Control0_ADDR		GPIOB_ODR_Addr
#define	Mcu_Control1_ADDR		GPIOH_ODR_Addr
#define	Mcu_Control2_ADDR		GPIOH_ODR_Addr
#define	Mcu_Control3_ADDR		GPIOH_ODR_Addr
#define	Mcu_Control4_ADDR		GPIOH_ODR_Addr
#define	Mcu_Control5_ADDR		GPIOH_ODR_Addr
#define	Mcu_Control6_ADDR		GPIOG_ODR_Addr
#define	Mcu_Control7_ADDR		GPIOD_ODR_Addr
#define	Mcu_Control8_ADDR		GPIOA_ODR_Addr
#define	Mcu_Control9_ADDR		GPIOI_ODR_Addr
#define	Mcu_Control10_ADDR		GPIOI_ODR_Addr
#define	Mcu_Control11_ADDR		GPIOI_ODR_Addr
#define	Mcu_Control12_ADDR		GPIOI_ODR_Addr
#define	Mcu_Control13_ADDR		GPIOI_ODR_Addr
#define	Mcu_Control14_ADDR		GPIOI_ODR_Addr
#define	Mcu_Control15_ADDR		GPIOG_ODR_Addr 

 
 

/*端口定义*/
/*
	MS_EN_E		PH3
	MS_EN_A0  PH5
	MS_EN_A1	PH4
	MS_EN_A2	PH2
	MS_EN_A3	PA1
 
*/ 
#define MS_EN_E_PORT			GPIOH
#define MS_EN_A0_PORT			GPIOH
#define MS_EN_A1_PORT			GPIOH
#define MS_EN_A2_PORT			GPIOH
#define MS_EN_A3_PORT			GPIOA
#define MS_EN_E_PIN				GPIO_PIN_3
#define MS_EN_A0_PIN			GPIO_PIN_5
#define MS_EN_A1_PIN			GPIO_PIN_4
#define MS_EN_A2_PIN			GPIO_PIN_2
#define MS_EN_A3_PIN			GPIO_PIN_1
#define MS_EN_E_RCC_ENABLE()		__HAL_RCC_GPIOH_CLK_ENABLE()  
#define MS_EN_A0_RCC_ENABLE()		__HAL_RCC_GPIOH_CLK_ENABLE() 
#define MS_EN_A1_RCC_ENABLE()		__HAL_RCC_GPIOH_CLK_ENABLE() 
#define MS_EN_A2_RCC_ENABLE()		__HAL_RCC_GPIOH_CLK_ENABLE() 
#define MS_EN_A3_RCC_ENABLE()		__HAL_RCC_GPIOA_CLK_ENABLE() 
/*位带操作*/
#define	MS_EN_E_BitNum		3
#define	MS_EN_A0_BitNum		5
#define	MS_EN_A1_BitNum		4
#define	MS_EN_A2_BitNum		2 
#define	MS_EN_A3_BitNum		1 
#define	MS_EN_E_ADDR		GPIOH_ODR_Addr 
#define	MS_EN_A0_ADDR		GPIOH_ODR_Addr 
#define	MS_EN_A1_ADDR		GPIOH_ODR_Addr 
#define	MS_EN_A2_ADDR		GPIOH_ODR_Addr 
#define	MS_EN_A3_ADDR		GPIOA_ODR_Addr 
/*端口定义*/
/*
	MS_A	PG14
	MS_B	PB9
	MS_C	PG10
	MS_D	PG13  
*/
#define MS_A_PORT			GPIOG
#define MS_B_PORT			GPIOB
#define MS_C_PORT			GPIOG
#define MS_D_PORT			GPIOG 
#define MS_A_PIN			GPIO_PIN_14
#define MS_B_PIN			GPIO_PIN_9
#define MS_C_PIN			GPIO_PIN_10
#define MS_D_PIN			GPIO_PIN_13 
#define MS_A_RCC_ENABLE()		__HAL_RCC_GPIOG_CLK_ENABLE()  
#define MS_B_RCC_ENABLE()		__HAL_RCC_GPIOB_CLK_ENABLE() 
#define MS_C_RCC_ENABLE()		__HAL_RCC_GPIOG_CLK_ENABLE()  
#define MS_D_RCC_ENABLE()		__HAL_RCC_GPIOG_CLK_ENABLE()   
/*位带操作*/
#define	MS_A_BitNum		14
#define	MS_B_BitNum		9
#define	MS_C_BitNum		10
#define	MS_D_BitNum		13 
#define	MS_A_ADDR		GPIOG_ODR_Addr 
#define	MS_B_ADDR		GPIOB_ODR_Addr 
#define	MS_C_ADDR		GPIOG_ODR_Addr 
#define	MS_D_ADDR		GPIOG_ODR_Addr  
/*端口定义*/
/*
	MS_A0	PB6
	MS_A1	PB5
	MS_A2	PB8
	MS_A3	PB7 
*/
#define MS_A0_PORT			GPIOB
#define MS_A1_PORT			GPIOB
#define MS_A2_PORT			GPIOB
#define MS_A3_PORT			GPIOB 
#define MS_A0_PIN			GPIO_PIN_6
#define MS_A1_PIN			GPIO_PIN_5
#define MS_A2_PIN			GPIO_PIN_8
#define MS_A3_PIN			GPIO_PIN_7  
#define MS_A0_RCC_ENABLE()		__HAL_RCC_GPIOB_CLK_ENABLE()  
#define MS_A1_RCC_ENABLE()		__HAL_RCC_GPIOB_CLK_ENABLE() 
#define MS_A2_RCC_ENABLE()		__HAL_RCC_GPIOB_CLK_ENABLE()  
#define MS_A3_RCC_ENABLE()		__HAL_RCC_GPIOB_CLK_ENABLE() 
/*位带操作*/
#define	MS_A0_BitNum		6
#define	MS_A1_BitNum		5
#define	MS_A2_BitNum		8
#define	MS_A3_BitNum		7  
#define	MS_A0_ADDR		GPIOB_ODR_Addr 
#define	MS_A1_ADDR		GPIOB_ODR_Addr 
#define	MS_A2_ADDR		GPIOB_ODR_Addr 
#define	MS_A3_ADDR		GPIOB_ODR_Addr   
/************************************************** *************/
 
#endif